
TO WORD WRAP THIS TEXT:

Click Edit on this screen's above toolbar and then click on Word Wrap.

TK3 SELECT PIC SIZE NOTES - 22FEB03

Some of this information may update that given in the published EPE TK3 text.

Always check the Updates file for any information that affects these notes. It is normally issued whenever an update to TK3 is released and is accessible via the "Latest Updates" button at the bottom of the main TK3 screen.


The Select PIC Type screen displays the PIC types for which TK3 has principally been designed. Their Program Memory (Commands) and Eeprom Data Memory capacities are shown. So too are their pinout sizes, although this information is not used by TK3.

The PIC type is selected by clicking on the required option and then clicking on OK to exit the screen, or double-clicking to select and exit the screen. This information is retained by TK3 until such time as you change it, or exit TK3. The default is for PIC16F84.

The User Specified Program Memory Size tick box allows you to retain the PIC type and its Eeprom data memory size, but enables you to select a different Program Memory size for use when disassembling a PIC (see below).

The selectable memory sizes are displayed in a drop down menu when the tick option is selected. They are in steps of 250 commands, from 250 commands to 8000 commands (250 has been chosen as the step value since it is easier to respond to visually - rather than steps of 256 which produce "untidy-looking" values!). Double-click on the required size value in order to select it and exit from the screen.

WHY SIZE MATTERS

There are several reasons why selecting the PIC type or its memory capacity are important.

First, disassembly of a PIC is always according to specified program data capacity for the PIC in question. There is no way in which the disassembler can know at which point the usable program code ends and where "garbage" begins. Only intelligent inspection of disassembled files can reveal this.

It is necessary to specify the PIC type being disassembled so that the disassembly knows when to cease data read back. If, for example, a PIC16F84, having 1024 program data memory locations, is read back as though it were a PIC16F877, the disassembler would read back data 8192 times, eight-times the capacity of the '84. This would result in the same PIC memory locations being read eight times, since the PIC16F84's internal address counter rolls over to zero after location 1023.

Conversly, reading back from a PIC16F877 when the disassembler is set for the size of an '84, will result in only one-eighth of the data being retrieved.

However, if you believe that the usable data within the PIC is less than its stated capacity, a smaller size value can be set, so speeding data retrieval.

A similar principle applies when sending or reading Eeprom Message data.

Note that when disassembling a PIC to ASM, or converting a HEX file to ASM, TK3 needs to allocate register header values appropriate to the PIC in question (remember that some PICs have more registers available than others). The header used is that relevant to the PIC type that was selected prior to selecting "non-standard" memory sizes. 

MPASM allows the PIC type to be named at the head of the source code. The naming is made in a statement such as LIST p=16F84 and is inserted by TK3 during conversion. Similarly, the PIC type is also specified when disassembling PIC program code to MPASM ASM. TASM source code does not require the PIC type to be specified (nor does TK3 when converting from MPASM to TASM). Note then a LIST p=PIC16F84 (for example) type of statement is encountered, TK3 checks its records and updates it PIC allocation accordingly, if appropriate.

The Configuration routine requires that the PIC type is specified to ensure that the data is correctly allocated. This only requires, though, that a PIC Family is chosen, the PIC name itself does not matter. The families are PIC16F84, PIC16F87x and PIC16F62x. The Config screen also offers access to PIC type selection.

It is up to you to ensure that the correct PIC type or family is chosen. An earlier development model of TK3 caused the PIC Select screen to be displayed each time some functions were selected. However, this proved to be not always beneficial and has been dropped.

ADDING YOUR OWN NOTES

These notes are displayed via an "Active" text editor and you may add your own notes to them, saving them to disk in the usual way.
